<%@ page import="json.person" %>
<%@ page import="bean.User" %><%--
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>login</title>
    <style type="text/css">
        *{
            margin: 0;
            padding: 0;
        }
        #wrap {
            height: 719px;
            width:100% ;
            background-image: url(img/bg4.jpg);
            background-repeat: no-repeat;
            background-position: center center;
            position: relative;
        }
        #head {
            height: 120px;
            width: 100;
            background-color: #66CCCC;
            text-align: center;
            position: relative;
        }
        #foot {
            width: 100;
            height: 126px;
            background-color: #CC9933;
            position: relative;
        }
        #wrap .logGet {
            height: 600px;
            width: 736px;
            position: absolute;
            background-color: #FFFFFF;
            top: 10%;
            left: 30%;
        }
        .logC a button {
            width: 100%;
            height: 45px;
            background-color: #40ee23;
            border: none;
            color: white;
            font-size: 18px;
        }
        .logGet .logD.logDtip .p1 {
            display: inline-block;
            font-size: 28px;
            margin-top: 10px;
            width: 86%;
        }
        .logGet .logD .p2 {
            display: inline-block;
            font-size: 28px;
            width: 86%;
            margin-top: 0px;
            margin-right: auto;
            margin-left: 50px;
        }
        #wrap .logGet .logD.logDtip {
            width: 86%;
            border-bottom: 1px solid #ee7700;
            margin-bottom: 60px;
            margin-top: 0px;
            margin-right: auto;
            margin-left: auto;
        }
        .logGet .lgD img {
            position: absolute;
            top: 12px;
            left: 8px;
        }
        .logGet .lgD input {
            width: 100%;
            height: 42px;
            text-indent: 2.5rem;
        }
        #wrap .logGet .lgD {
            width: 86%;
            position: relative;
            margin-bottom: 30px;
            margin-top: 30px;
            margin-right: auto;
            margin-left: auto;
        }
        #wrap .logGet .logC {
            width: 30%;
            margin-top: 0px;
            margin-right: auto;
            margin-bottom: 0px;
            margin-left: auto;
        }


        .title {
            font-family: "宋体";
            color: #FFFFFF;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 36px;
            height: 40px;
            width: 30%;
        }
        #foot .copyright p {
            height: 24px;
            width: 100%;
        }
    </style>
</head>
<html>
</head>

<body>
<div class="header" id="head">
    <div class="title">登录管理系统</div>

</div>
<body>
<%!
    String username=null;
    String email=null;
    String img=null;
    String id=null;
%>
<%
    User user=(User)request.getSession().getAttribute("LocalUser");
    if(user==null)
    {
        response.sendRedirect("index.jsp");
    }
    if(user!=null) {
        username = user.getUsername();
        email = user.getEmail();
        img = user.getImg();
        id = user.getId();;
    }
%>

<div class="wrap" id="wrap">
    <div class="logGet">
        <!-- 头部提示信息 -->
        <div class="logD logDtip">
            <p class="p1">个人信息</p>
        </div>
        <div class="logD">
            <p class="p2">名称：<%=username%></p>
            <p class="p2">dgut学号：<%=id%></p>
            <p class="p2">邮箱：<%=email%></p>

        </div>
        <div class="logD">

            <p class="p2">头像:</p>
            <p class="p2"><img src="<%=img %>" width="100" height="125" class="fltlft" />
                <br>
            <div class="logC">
                <a href="javascript:;" class="file"><button onclick="uploadImg()">选择文件</button></a>
            </div>
            <form action="/img_change" enctype="multipart/form-data" method ="post" >
            <input type="file" name="img" id="img" style="display:none">

            <br>

            <div class="logC">
                <a href="img_change" type="submit" name="upload" value="点击上传" class="file"/><button>点击上传</button>

            </div>
            </form>
            </p>

            <br>
            <div class="logC">
                <a href="Exit"><button>退出登录</button>
                </form>
            </div>
            <p class="p2">&nbsp</p>
    </div>
</div>

<script>
    function uploadImg() {
        document.getElementById("img").click();
    }
</script>
</body>
</html>